﻿using Microsoft.Xna.Framework.Graphics;

namespace TrinityEngine
{
    public class Text : Renderer
    {
        public Font font;

        public string text;

        public float size;

        public Text(Font font, string text)
        {
            this.font = font;
            this.text = text;
            size = 1f;
        }
        protected override void Update()
        {
            base.Update();
            /*_origin = new Vector2(text.Length * pivot.x, pivot.y) * font.size / 2f;*/
        }

        protected override void Render()
        {
            if (font == null)
            {
                return;
            }

            /*Engine.Instance.batch.DrawString(
                font.font,
                text,
                new Vector2(_position.x, -_position.y),
                tint,
                _rotation,
                _origin,
                _scale * size / font.size,
                SpriteEffects.None,
                sortingLayer);*/
        }

        protected override void OnDestroy()
        {
            font = null;
            text = string.Empty;
        }
    }
}
